// 字典类型管理和字典数据管理API
import request from "./axios";


export const DictTypeAPI = {
    getList: (params) => request.get("/system/dict/type/list", { params }),
    create: (data) => request.post("/system/dict/type", data),
    update: (id, data) => request.put(`/system/dict/type`, data),
    get: (id) => request.get(`/system/dict/type/${id}`),
    delete: (id) => request.delete(`/system/dict/type/${id}`),
    // 获取字典选择框列表
    getSelectList: () => request.get("/system/dict/type/optionSelect"),
};

export const DictDataAPI = {
    create: (data) => request.post("/system/dict/data", data),
    update: (id, data) => request.put(`/system/dict/data`, data),
    //   列表
    getList: (params) => request.get("/system/dict/data/list", { params }),
    // 详情
    get: (dictCode) => request.get(`/system/dict/data/${dictCode}`),
    //   删除
    delete: (dictCodes) => request.delete(`/system/dict/data/${dictCodes}`),

    //   根据字典类型查询字典数据信息
    getByType: (dictType) => request.get(`/system/dict/data/type/${dictType}`),
};